using System;
using System.Globalization;
using System.Windows.Data;

namespace PCR.Converter
{
	public class TimeChangeMaxConverter : IMultiValueConverter
	{
		public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
		{
			int num = int.Parse(values[0].ToString());
			int num2 = int.Parse(values[1].ToString());
			int num3 = int.Parse(values[2].ToString());
			int num4 = int.Parse(values[3].ToString());
			int num5 = int.Parse(values[4].ToString());
			double? num6 = 0.0;
			return ((num5 != 0) ? new double?((num * 60 + num2) / (num3 - num4 + 1)) : new double?((5999 - (num * 60 + num2)) / (num3 - num4 + 1))).Value;
		}

		public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
		{
			return null;
		}
	}
}
